<?php
/*************************************************************************

  $Id: osc22ms2.config.php 543 2010-07-15 12:47:10Z dis $

  iclear payment system - because secure is simply secure
  http://www.iclear.de

  Copyright (c) 2001 - 2009 iclear

  Released under the GNU General Public License

************************************************************************

                    All rights reserved.

  This program is free software licensed under the GNU General Public License (GPL).

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  USA

*************************************************************************/

  if(!defined('IC_SEC')) {
    die('No external calls allowed!');
  }

  global $icCore;
  
// following code is only in use if this is an asynchronous call (application_top.php not in use)
  if(!defined('DIR_WS_CATALOG')) {
  	define('IC_STANDALONE', true);
  	
  	$icSysPath = $icCore->getPath();
    require $icSysPath . 'includes/configure.php';
    
// define the project version
  define('PROJECT_VERSION', 'osCommerce 2.2-MS2');

// set the type of request (secure or not)
  $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

// define the filenames used in the project
    require DIR_WS_INCLUDES . 'filenames.php';
// define the database table names used in the project
    require DIR_WS_INCLUDES . 'database_tables.php';
    
// needed 4 email class!
    define('CHARSET', 'iso-8859-1');
	  
	  if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
	  if ($request_type == 'NONSSL') {
	    define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
	  } else {
	    define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
	  }
	  require $icSysPath . DIR_WS_FUNCTIONS . 'database.php';
	  tep_db_connect() or die('Unable to connect to database server!');
	// get application configuration
	  $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
	  while ($configuration = tep_db_fetch_array($configuration_query)) {
	    define($configuration['cfgKey'], $configuration['cfgValue']);
	  }
	  
// load classes / functions needed in storeOrder 4 OSC mods
    require(DIR_WS_FUNCTIONS . 'general.php');
    require(DIR_WS_FUNCTIONS . 'html_output.php');
    require(DIR_WS_FUNCTIONS . 'sessions.php');
    require(DIR_WS_CLASSES . 'order_total.php');
    require(DIR_WS_CLASSES . 'email.php');
    require(DIR_WS_CLASSES . 'mime.php');
    require_once DIR_WS_CLASSES . 'shopping_cart.php';
    
    global $currencies;
    require(DIR_WS_CLASSES . 'currencies.php');
	  $currencies = new currencies();
  }
  
  // xonic 1.5 patch
  if($icCore->cloneID() == 'xonic15') {
  	define('IC_SESSION_NAME', 'xploidID');
  } else {
   define('IC_SESSION_NAME', 'osCsid');
  }
  
// reusing osc22ms1 wrapper!
  require_once dirname(__FILE__) . '/' . 'osc22ms1.php';
?>